package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderDetailMapper {

    /*
    * 批量插入多条订单明细数据
    * */
    void insertOrderDetailBatch(List<OrderDetail> orderDetailList);

    /*
    * 根据orderId查询订单明细信息
    * */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> selectOrderDetailByOrderId(Long orderId);

    /*
    * 根据日期查询销量排行前十菜品
    * */
    List<GoodsSalesDTO> selectSalesTop10ByDate(Map map);
}
